#include <iostream>
#include <cstdio>
#include <vector>

using namespace std;

int n,m,k;
int abss(int t){return t<0?-t:t;}
int min(int a,int b){return a<b?a:b;}
bool f(int a,int b)
{
	if(abss(a-1)<=8||abss(n-a)<=8) return true;
	if(abss(b-1)<=8||abss(m-b)<=8) return true;
	return false;
}
int main()
{
	bool legal;
	int a,b;
	while(cin>>n>>m>>k)
	{
		legal=false;
		while(k--)
		{
			cin>>a>>b;
			if(f(a,b))legal=true;
		}
		if(legal) cout<<"YES"<<endl;
		else cout<<"NO"<<endl;
	}
	return 0;
}

